package com.guigu.www.luolujin.Conteoller;
import com.guigu.www.luolujin.Service.LljTemplateKeepService;
import com.guigu.www.pojo.PageVo;
import com.guigu.www.pojo.TemplateFood;
import com.guigu.www.pojo.TemplateKeep;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 作者 罗露金
 */
@RestController
@RequestMapping("/LljTemplateKeepServlet")
public class LljTemplateKeepServlet {
    @Autowired
    LljTemplateKeepService service;
    @GetMapping()
    public PageVo<TemplateKeep> pageTemKeep(Integer pageNum, Integer pageSize, String tempKeepName){
        return service.pageTemKeep(pageNum, pageSize, tempKeepName);
    }
    @PostMapping
    public void insertTemKeep(@RequestBody TemplateKeep templateKeep){
        service.insertTemKeep(templateKeep);
    }
    @DeleteMapping("{id}")
    public void deleteTemKeep(@PathVariable("id") Integer tempKeepId){
        service.deleteTemKeep(tempKeepId);
    }

    @PutMapping
    public void updateTemKeep(@RequestBody TemplateKeep templateKeep){
        service.updateTemKeep(templateKeep);
    }
    @GetMapping("{id}")
    public TemplateKeep selectById(@PathVariable("id") Integer tempKeepId) {
        return service.selectById(tempKeepId);
    }
    @PutMapping("/state")
    public void upTemKeep(Integer tempKeepId, Integer tempWhoState){
        service.upTemKeep(tempKeepId, tempWhoState);
    }
    @GetMapping("/all")
    public List<TemplateKeep> queryAll() {
        return service.queryAll();
    }
}
